{include file="public/head" /}
<!--有理想的地方，地狱都是天堂-->
<!--Copyright @ df81.com 版权所有-->
<!--作者: 南国老符 邮箱：1062129401@qq.com-->
        <!-- 左侧菜单 开始 -->
        <div class="sidebar">
            <nav>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_content" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy {if !in_array($tabledir,array('feedback','shop_aftersale'))}d-block d-md-none{/if}" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_data" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy {if in_array($tabledir,array('feedback','send_template','shop_aftersale'))}d-block d-md-none{/if}" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_global" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy {if !in_array($tabledir,array('send_template'))}d-block d-md-none{/if}" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_system" /}
                </ul>
            </nav>
        </div>
        <!-- 左侧菜单 结束 -->
    </aside>
    <!-- 左侧 结束 -->
    <!-- 右侧 开始 -->
    <div class="content-wrapper">
        <!-- 内容导航 开始 -->
        <div class="content-header py-2 bg-white mb-3">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <ol class="breadcrumb">
                            <li>{$att_nav}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{$att_nav}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>
                                {if $tabledir eq 'send_template'}
                                    {:lang('v_sms')} {:lang('v_email')} {:lang('v_template')}
                                {else /}
                                    {$module_title} {:lang('v_manage')}
                                {/if}
                                <i class="fas fa-angle-right mx-2"></i>
                            </li>
                            <li>{empty name="rs.id"}{:lang('v_add')}{else /}{:lang('v_edit')}{/empty} {:lang('v_attribute')}</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <!-- 内容导航 结束 -->
        <!-- 内容主体 开始 -->
        <section class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="w-100 pt-3 pb-2 bg-white rounded mb-3">
                            <form name="form_keyword" action="{:url('/attribute/index',['lang'=>$lang,'tabledir'=>$tabledir])}" method="post" class="row">
                                <input type="hidden" name="lang" value="{$lang}">
                                <input type="hidden" name="tabledir" value="{$tabledir}">
                                <div class="col-md-8">
                                    {switch tabledir}
                                        {case ad}
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/ad/index',['lang'=>$lang,'att_type'=>'banner'])}"><i class="fa fa-fw fa-image mr-1"></i>{:lang('v_banner')} {:lang('v_manage')}</a>
                                            {tag:list name="atRs" table="attribute" where="lang='$lang' and tabledir='Ad'" limit="10" order="sequence desc"}
                                                <a class="btn {if input('att_type') eq $atRs['title']}btn-success{else /}btn-default{/if} mb-2 mr-2" href="{:url('/ad/index',['lang'=>$lang,'att_type'=>$atRs['title']])}"><i class="fas fa-fw fa-bars mr-1"></i>{$atRs.title} {:lang('v_manage')}</a>
                                            {/tag:list}
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/ad/edit',['lang'=>$lang])}"><i class="fa fa-fw fa-plus-circle mr-1"></i>{:lang('v_add')} {:lang('v_ad')}</a>
                                        {/case}
                                        {case chat}
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/chat/index',['lang'=>$lang])}"><i class="fas fa-fw fa-headset mr-1"></i>{:lang('v_chat')} {:lang('v_manage')}</a>
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/chat/edit',['lang'=>$lang])}"><i class="fa fa-fw fa-plus-circle mr-1"></i>{:lang('v_add')} {:lang('v_chat')}</a>
                                        {/case}
                                        {case feedback}
                                            {if config('app.other.system_type') neq 'company'}
                                                <a class="btn btn-default mb-2 mr-2" href="{:url('/feedback/index',['lang'=>$lang,'signid'=>3])}"><i class="fa fa-fw fa-eye mr-1"></i>{:lang('v_no_reply')}</a>
                                                <a class="btn btn-default mb-2 mr-2" href="{:url('/feedback/index',['lang'=>$lang,'signid'=>1])}"><i class="fa fa-fw fa-check-circle mr-1"></i>{:lang('v_yes_reply')}</a>
                                            {else /}
                                                <a class="btn btn-default mb-2 mr-2" href="{:url('/feedback/index',['lang'=>$lang,'signid'=>3])}"><i class="fa fa-fw fa-eye mr-1"></i>{:lang('v_feedback')} {:lang('v_manage')}</a>
                                            {/if}
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/feedback/index',['lang'=>$lang,'signid'=>9])}"><i class="fa fa-fw fa-recycle mr-1"></i>{:lang('v_recycle')}</a>
                                        {/case}
                                        {case navigation}
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/navigation/index',['lang'=>$lang,'client'=>'pc'])}"><i class="fas fa-fw fa-desktop mr-1"></i>{:lang('v_client_pc')}</a>
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/navigation/index',['lang'=>$lang,'client'=>'wap'])}"><i class="fas fa-fw fa-mobile-alt mr-1"></i>{:lang('v_client_mobile')}</a>
                                            {if config('app.isdisplay.uniapp') eq 1}
                                                <a class="btn btn-default mb-2 mr-2" href="{:url('/navigation/index',['lang'=>$lang,'client'=>'app'])}"><i class="fab fa-fw fa-android mr-1"></i>{:lang('v_client_uniapp')}</a>
                                            {/if}
                                            <a class="btn mb-2 mr-2 btn-default" href="{:url('/navigation/index',['lang'=>$lang,'signid'=>9,'client'=>input('client')])}"><i class="fa fa-fw fa-recycle mr-1"></i>{:lang('v_recycle')}</a>
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/navigation/edit',['lang'=>$lang,'client'=>input('client')])}"><i class="fa fa-fw fa-plus-circle mr-1"></i>{:lang('v_add')} {:lang('v_navigation')}</a>
                                        {/case}
                                        {case send_template}
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/send_template/index',['lang'=>$lang,'temp_type'=>'email'])}"><i class="fa fa-fw fa-envelope mr-1"></i>{:lang('v_email')} {:lang('v_template')}</a>
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/send_template/index',['lang'=>$lang,'temp_type'=>'sms'])}"><i class="fa fa fa-fw fa-mobile-alt mr-1"></i>{:lang('v_sms')} {:lang('v_template')}</a>
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/send_template/edit',['lang'=>$lang])}"><i class="fa fa-fw fa-plus-circle mr-1"></i>{:lang('v_add')} {:lang('v_template')}</a>
                                        {/case}
                                        {case shop_aftersale}
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/shop_aftersale/index',['lang'=>$lang,'signid'=>1])}">{:lang('shopv_doing')}</a>
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/shop_aftersale/index',['lang'=>$lang,'signid'=>2])}">{:lang('shopv_done')}</a>
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/shop_aftersale/index',['lang'=>$lang,'signid'=>9])}">{:lang('v_recycle')}</a>
                                        {/case}
                                    {/switch}
                                    <a class="btn btn-default mb-2 mr-2" href="{:url('/attribute/index',['lang'=>$lang,'tabledir'=>$tabledir])}"><i class="fa fa-fw fa-tag mr-1"></i>{:lang('v_attribute')} {:lang('v_manage')}</a>
                                    <a class="btn {eq name="action" value="edit"}btn-success{else /}btn-default{/eq} mb-2 mr-2" href="{:url('/attribute/edit',['lang'=>$lang,'tabledir'=>$tabledir])}"><i class="fa fa-fw fa-plus-circle mr-1"></i>{:lang('v_add')} {:lang('v_attribute')}</a>
                                </div>
                                <div class="col-md-4">
                                    <div class="input-group">
                                        <input name="keyword" placeholder="{:lang('v_quickfind')}" type="text" class="form-control">
                                        <span class="input-group-append">
                                            <button type="submit" class="btn btn-success"><i class="fa fa-search mr-1"></i>{:lang('v_search')}</button>
                                        </span>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="card card-outline card-success">
                            <div class="card-header">
                                <i class="fas fa-edit mr-1"></i>{empty name="rs.id"}{:lang('v_add')}{else /}{:lang('v_edit')}{/empty} {:lang('v_attribute')}
                            </div>
                            <div class="card-body">
                                <form name="form_edit" id="form_edit" method="post" action="{:url('/attribute/edit',['lang'=>$lang,'tabledir'=>$tabledir])}">
                                    <input type="hidden" name="id" value="{$rs.id}">
                                    <input type="hidden" name="lang" value="{$lang}">
                                    <input type="hidden" name="tabledir" value="{$tabledir}">
                                    <div class="row form-group">
                                        <div class="col-md-3 col-form-label text-right text-danger">{:lang('v_attribute_name')} *</div>
                                        <div class="col-md-4">
                                            <input type="text" class="form-control" name="title" value="{$rs.title}" />
                                        </div>
                                    </div>
                                    <div class="row form-group {if !in_array($tabledir,array('feedback'))}d-none{/if}">
                                        <div class="col-md-3 col-form-label text-right">{:lang('v_display_method')}</div>
                                        <div class="col-md-5">
                                            <label class="form-check form-check-inline">
                                                <input name="fieldtype" type="radio" value="radio"{if $rs.fieldtype eq 'radio' or empty($rs.fieldtype)} checked="checked"{/if} class="form-check-input" />{:lang('v_method_select')}
                                            </label>
                                            <label class="form-check form-check-inline">
                                                <input type="radio" name="fieldtype" value="checkbox"{eq name="rs.fieldtype" value="checkbox"} checked="checked"{/eq} class="form-check-input" />{:lang('v_method_checkbox')}
                                            </label>
                                            <label class="form-check form-check-inline">
                                                <input type="radio" name="fieldtype" value="text"{eq name="rs.fieldtype" value="text"} checked="checked"{/eq} class="form-check-input" />{:lang('v_method_text')}
                                            </label>
                                            <label class="form-check form-check-inline">
                                                <input type="radio" name="fieldtype" value="textarea"{eq name="rs.fieldtype" value="textarea" } checked="checked"{/eq} class="form-check-input" />{:lang('v_method_textarea')}
                                            </label>
                                        </div>
                                    </div>
                                    <div class="row form-group {if !in_array($tabledir,array('feedback','send_template'))}d-none{/if}">
                                        <div class="col-md-3 col-form-label text-right text-danger">{:lang('v_attribute_value')} *</div>
                                        <div class="col-md-4">
                                            {if in_array($tabledir,array('send_template'))}
                                                <input type="text" name="attvalue" value="{$rs.attvalue}" class="form-control">
                                                <span class="text-muted">{:lang('shopv_attribute_tips')}</span>
                                            {else /}
                                                <textarea name="attvalue" rows="5" class="form-control" placeholder="{:lang('v_oneline_onevalue')}">{$rs.attvalue}</textarea>
                                            {/if}
                                        </div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col-md-3 col-form-label text-right">{:lang('v_sequence')}</div>
                                        <div class="col-md-4">
                                            <input type="text" class="form-control checkstock" name="sequence" value="{empty name="rs.sequence"}0{else /}{$rs.sequence}{/empty}" />
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="offset-md-3 col-md-9 mb-4">
                                            {if is_file(app()->getRootPath().'.env')}
                                                <button type="submit" class="do_ajax btn btn-success mr-4"><i class="fas fa-check-circle mr-2"></i>{:lang('v_save')}</button>
                                            {else /}
                                                <button type="button" class="do_ajax btn btn-success mr-4" onclick="javascript:do_ajax('#form_edit','.do_ajax','{:url('/attribute/edit',['lang'=>$lang,'tabledir'=>$tabledir])}','{:url('/attribute/index',['lang'=>$lang,'tabledir'=>$tabledir])}');"><i class="fa fa-check-circle mr-2"></i>{:lang('v_save')}</button>
                                            {/if}
                                            <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);"><i class="fa fa-angle-double-left mr-1"></i>{:lang('v_goback')}</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- 内容主体 结束 -->
    </div>
    <!-- 右侧 结束 -->
{include file="public/foot" /}
</body>
</html>